import request from "@/utils/request.js";

const PREFIX = '/user/address'

// 获取地址列表
export const getAddresses = async () => {
    return await request(`${PREFIX}`)
}

// 添加地址
export const addOrUpdateAddress = async (address) => {
    return await request.post(`${PREFIX}`, {...address,isDefault:Number(address.isDefault)});
}

// 删除地址
export const deleteAddress = async (id) => {
    return await request.delete(`${PREFIX}/${id}`)
}
